package com.juc.callable.callable6;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Run {

	/**
	 * 异常处理
	 * @param args
	 */
	public static void main(String[] args) {
		MyCallable myCallable = new MyCallable("1");
		ExecutorService executorService = Executors.newCachedThreadPool();
		Future<String> future = executorService.submit(myCallable);
		try {
			System.out.println(future.get());
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ExecutionException e) {
			System.out.println(" 里面出错了！");
			e.printStackTrace();
		}
		
	}
}
